package cn.iocoder.yudao.module.design.dal.mysql.problemdealerrel;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.design.controller.admin.problemdealerrel.vo.ProblemDealerRelExportReqVO;
import cn.iocoder.yudao.module.design.controller.admin.problemdealerrel.vo.ProblemDealerRelPageReqVO;
import cn.iocoder.yudao.module.design.dal.dataobject.problemdealerrel.ProblemDealerRelDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 问题处理人关联 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ProblemDealerRelMapper extends BaseMapperX<ProblemDealerRelDO> {

    default PageResult<ProblemDealerRelDO> selectPage(ProblemDealerRelPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProblemDealerRelDO>()
                .eqIfPresent(ProblemDealerRelDO::getUserId, reqVO.getUserId())
                .eqIfPresent(ProblemDealerRelDO::getProblemId, reqVO.getProblemId())
                .eqIfPresent(ProblemDealerRelDO::getStatusCd, reqVO.getStatusCd())
                .eqIfPresent(ProblemDealerRelDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(ProblemDealerRelDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ProblemDealerRelDO::getId));
    }

    default List<ProblemDealerRelDO> selectList(ProblemDealerRelExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ProblemDealerRelDO>()
                .eqIfPresent(ProblemDealerRelDO::getUserId, reqVO.getUserId())
                .eqIfPresent(ProblemDealerRelDO::getProblemId, reqVO.getProblemId())
                .eqIfPresent(ProblemDealerRelDO::getStatusCd, reqVO.getStatusCd())
                .eqIfPresent(ProblemDealerRelDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(ProblemDealerRelDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ProblemDealerRelDO::getId));
    }



}
